<gm:page title="Advanced Template" authenticate="true">

    <!--
       The Advanced Template application demonstrates using a template with
       several controls to create a interactive user experience.
       @author: GME Team
    -->


  <div class="gm-app-header">
    <h1>Olympic Games</h1>
  </div>

 
  <!-- Pager -->
  <gm:list id="myList2" data="${test}" template="ListTemplate" pagesize="8"/>
  
  <gm:template id="ListTemplate">
    <gm:pager/>
    <ul>
      <li repeat="true"><gm:text ref="atom:title"/></li>
    </ul>
  </gm:template>
  <!-- End Pager -->
 <br />
 <br />    
  <!-- Tabs -->
     <gm:tabs target="myContainer"/>

    <gm:container id="myContainer" style="padding:3px;border:1px solid #369;width:600px;">
      
      <gm:section id="section1" title="Simple">
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla dictum
        porta lorem. In eu elit quis lorem laoreet venenatis. Aenean
        ullamcorper. Duis risus ante, varius id, posuere posuere, ultricies
        vitae, pede. In id felis. Mauris ligula. Sed tempus tortor a mauris. Nam
        non eros. Suspendisse massa tellus, feugiat vel, suscipit vitae,
        venenatis quis, ante. Fusce sit amet turpis. Nam a ligula nec magna
        facilisis varius. Donec faucibus lobortis neque. Morbi tellus neque,
        consequat a, interdum eu, bibendum vel, est.
      </gm:section>

      <gm:section id="section2" title="Simple List">
        <gm:list id="testList" data="${test}"/>
      </gm:section>

      <gm:section id="section3" title="RSS Feed">
        <gm:list id="myList3" data="http://www.digg.com/rss/index.xml" pagesize="10"/>
      </gm:section>
    
    </gm:container>
    <!-- Tabs -->  
 
 <br />
 <br />

      <!-- List -->

  <gm:list id="myList" template="myTemplate" data="${myData}" class="gm-noselect" />
   
  <!-- Template -->

  <gm:template id="myTemplate">
    <table width="600">
      <thead>
        <tr>
          <td width="150"><gm:header>Rating</gm:header></td>
          <td width="250"><gm:header>City</gm:header></td>
          <td width="200"><gm:header>Date</gm:header></td>
        </tr>
      </thead>
      <tfoot>
        <tr class="gm-header">
          <td></td>
          <td colspan="2">
            <gm:create label="Create Item"/>
          </td>
        </tr>
      </tfoot>

      <tbody repeat="true">
        <tr valign="top">
          <td align="center" rowspan="2">
            <gm:image ref="atom:link[@rel='photo']/@href" width="150"/>
            <div align="center">
              <gm:rating ref="gd:rating"/>
              <gm:editButtons/>
            </div>
          </td>
          <td><b><gm:text ref="atom:title"/></b></td>
          <td>
            <gm:date ref="gd:when/@startTime"/>
            <span style="padding:10px">to</span>
            <gm:date ref="gd:when/@endTime"/>
          </td>
        </tr>
        <tr>
          <td colspan="2">
          <p><gm:textarea ref="atom:content"/></p>
          </td>
        </tr>
        <tr>
          <td colspan="2"></td>
        </tr>
      </tbody>
    </table>
  </gm:template>

  <!-- Data module -->

  <gm:data id="myData" mutable="true">
    <atom:feed>
      <atom:title>Olympic Games</atom:title>

      <atom:entry>
        <atom:id>1</atom:id>
        <atom:title>Athens</atom:title>
        <atom:link rel="edit" href="1"/>
        <atom:link rel="photo" href="http://www.olympic.org/upload/games/2004S_city.gif"/>
        <atom:content>
          In 2004 the Olympic Games returned to Greece, the home of both
          the ancient Olympics and the first modern Olympics. For the first
          time ever a record 201 National Olympic Committees (NOCs) participated
          in the Olympic Games. The overall tally for events on the programme was
          301 (one more than in Sydney 2000).
        </atom:content>
        <gd:rating value="5" min="0" max="5"/>
        <gd:when startTime="2004-08-13" endTime="2004-08-29"/>
      </atom:entry>

      <atom:entry>
        <atom:id>2</atom:id>
        <atom:title>Sydney</atom:title>
        <atom:link rel="edit" href="2"/>
        <atom:link rel="photo" href="http://www.olympic.org/upload/games/2000S_city.gif"/>
        <atom:content>
          The Sydney 2000 Games were the largest yet, with 10,651
          athletes competing in 300 events. Despite their size,
          they were well organised, renewing faith in the Olympic Movement.
          Birgit Fischer earned two gold medals in Kayak to become the first
          woman in any sport to win medals 20 years apart.
        </atom:content>
        <gd:rating value="4" min="0" max="5"/>
        <gd:when startTime="2000-09-15" endTime="200-10-01"/>
      </atom:entry>

      <atom:entry>
        <atom:id>3</atom:id>
        <atom:title>Atlanta</atom:title>
        <atom:link rel="edit" href="3"/>
        <atom:link rel="photo" href="http://www.olympic.org/upload/games/1996S_city.gif"/>
        <atom:content>
          The 1996 Games were given a dramatic start when the cauldron was lit by
          Muhammad Ali. On 27 July during a concert held in the Centennial Olympic Park,
          a terrorist bomb killed one person and injured a further 110 people, but the
          Atlanta Games are best remembered for their sporting achievements.
        </atom:content>
        <gd:rating value="3" min="0" max="5"/>
        <gd:when startTime="1996-07-19" endTime="1996-08-04"/>
      </atom:entry>

    </atom:feed>
  </gm:data>

</gm:page>
